package com.huan.spring6.junit;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

//设置配置文件位置
//第一种方式
//@SpringJUnitConfig(locations = "classpath:bean.xml")
//第二种方式
@ExtendWith(SpringExtension.class)
@ContextConfiguration("classpath:bean.xml")
public class TestUserJunit5 {
    @Autowired
    private User user;
    @Test
    public void testUser(){
        System.out.println(user);
        user.run();
    }
}
